package com.hc.tenant.listener;

import com.hc.common.core.utils.StringUtils;
import com.hc.tenant.listener.MqttEvenPublisher;
import com.hc.tenant.listener.MqttEventListener;
import com.hc.tenant.listener.event.MqttEvent;
import org.springframework.stereotype.Component;

@Component
public class ChatListener implements MqttEventListener {
    @Override
    public void onMqttEvent(MqttEvent mqttEvent) {
        if(StringUtils.equals("chat",(String)mqttEvent.getSource())){
            System.out.println(mqttEvent.getMqttMessage());
        }
    }
}
